home *** CD-ROM | disk | FTP | other *** search
- global phase
-
- on mouseDown me
- set L0 to the left of sprite 2
- set r0 to the right of sprite 2
- set the floatPrecision to 3
- set the cursor of sprite the spriteNum of me to [member "Closed Hand", member "Closed Hand Mask"]
- repeat while the stillDown
- if (the mouseH < (r0 + 2)) and (the mouseH > (L0 - 2)) then
- set the locH of sprite 3 to the mouseH
- set phase to -90 + float((the locH of sprite 3 - L0) * 0.42899999999999999)
- if integer(phase) > 0 then
- if the hilite of cast "Degrees" then
- put "+" & integer(phase) into field "A"
- else
- set the floatPrecision to 1
- put "+" & phase * PI / 180.0 into field "A"
- end if
- else
- if the hilite of cast "Degrees" then
- put integer(phase) into field "A"
- else
- set the floatPrecision to 1
- put phase * PI / 180.0 into field "A"
- end if
- end if
- end if
- updateStage()
- end repeat
- if value(field "A" = "0") then
- put "+0" into field "A"
- end if
- end
-
- on mouseUp me
- set the trails of sprite 19 to 1
- set the trails of sprite 20 to 1
- if the foreColor of sprite 19 >= 6 then
- set the foreColor of sprite 19 to 0
- else
- set the foreColor of sprite 19 to the foreColor of sprite 19 + 1
- end if
- set the locV of sprite 19 to 900
- set the foreColor of sprite 20 to 8
- set the cursor of sprite the spriteNum of me to [member "Hand", member "Hand Mask"]
- updateStage()
- set x0 to the locH of sprite 15 + 1
- set y0 to the locV of sprite 15
- repeat with n = 0 to 120
- set the locH of sprite 19 to (2.39999999999999991 * n) + x0
- set the locH of sprite 20 to (2.39999999999999991 * n) + x0
- if the hilite of cast "Sine" then
- set the locV of sprite 19 to y0 - (50.0 * float(sin(((3.0 * n) + phase) * PI / 180.0)))
- set the locV of sprite 20 to y0 - (50.0 * float(sin(n * 3.0 * PI / 180.0)))
- updateStage()
- end if
- if the hilite of cast "Cosine" then
- set the locV of sprite 19 to y0 - (50.0 * float(cos(((3.0 * n) + phase) * PI / 180.0)))
- set the locV of sprite 20 to y0 - (50.0 * float(cos(n * 3.0 * PI / 180.0)))
- updateStage()
- end if
- if the hilite of cast "Tangent" then
- set the locV of sprite 19 to y0 - (50.0 * float(tan(((3.0 * n) + phase) * PI / 180.0)))
- set the locV of sprite 20 to y0 - (50.0 * float(tan(n * 3.0 * PI / 180.0)))
- updateStage()
- end if
- updateStage()
- end repeat
- set the locV of sprite 19 to 900
- set the locV of sprite 20 to 900
- end
-
- on beginSprite me
- set the cursor of sprite the spriteNum of me to [member "Hand", member "Hand Mask"]
- put "+ 0" into field "A"
- set the hilite of cast "Degrees" to 1
- set the hilite of cast "Radians" to 0
- set the locH of sprite 3 to the left of sprite 2 + 210
- set the hilite of cast "Sine" to 1
- set the hilite of cast "Cosine" to 0
- set the hilite of cast "Tangent" to 0
- end
-
- on endSprite me
- set the cursor of sprite the spriteNum of me to 0
- end
-